
//  LifeViewController.m
//  LazyCat
//
//  Created by zhanshu on 15/9/7.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//
#import "LifeViewController.h"
#import "MyHeaderTableViewCell.h"
#import "MyMessTableViewCell.h"
#import "shopNoteTableViewCell.h"

@interface LifeViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UIPickerViewDataSource,UIPickerViewDelegate,UITextViewDelegate>
{
    UITableView *tableV;
    UIView *footView;
    UIImage *headerImg;
    UISwitch *swi;//店铺状态开关
    NSString *state;//开关状态
    UILabel *replceLabel;
    UITextView *textV;
    NSString *shopName;//超市名称
    
    NSString *shopnote;//超市公告
    NSString *minSendMoney;//最小起送金额
    NSString *severMoney;//服务费
    
    NSMutableArray *dataArray1;
    NSMutableArray *dataArray2;
    UIPickerView *pickerView;
    UIView *timeView;
    UIView *popView;
    NSString *timeLabel2;//营业时间
    NSString *start;
    NSString *end;
}
@end

@implementation LifeViewController

-(UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (![[ShopCommonModel share].shopname isEqualToString:@""]) {
        shopName = [ShopCommonModel share].shopname;
        state = [ShopCommonModel share].openstatu;
        start = [ShopCommonModel share].begintime;
        end = [ShopCommonModel share].endtime;
        minSendMoney = [ShopCommonModel share].minsendamount;
        severMoney = [ShopCommonModel share].serviceamount;
        shopnote = [ShopCommonModel share].notice;
    }else {
        shopName = @"";
        state = @"0";
        start = @"00:00";
        end = @"00:00";
        minSendMoney = @"0";
        severMoney = @"0";
        shopnote = @"";
    }
    textV.text = [NSString stringWithFormat:@"%@",[ShopCommonModel share].notice];
    if ([ShopCommonModel share].notice.length == 0) {
        replceLabel.hidden = NO;
    }else {
        replceLabel.hidden = YES;
    }
    [tableV reloadData];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navBar.backgroundColor = MainColor;
    [self initNav:@"店铺设置" doBack:NO];
    
    [self createFootView];
    [self createTable];
    [self createPickerView];
}
-(void)initNav:(NSString*)title doBack:(BOOL)doBack {
    self.navBar.hidden=NO;
    self.titleLable.text=title;
    self.titleLable.textColor = [UIColor whiteColor];
    
    UIButton *saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    saveBtn.frame = CGRectMake(ScreenWidth - 45, 28, 42, 30);
    [saveBtn addTarget:self action:@selector(saveBtn) forControlEvents:UIControlEventTouchUpInside];
    [saveBtn setTitle:@"保存" forState:UIControlStateNormal];
    [saveBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    saveBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    [self.navBar addSubview:saveBtn];
}
-(void)createFootView {
    footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 70)];
    footView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:footView];
    
    UIView *backV = [[UIView alloc]initWithFrame:CGRectMake(0, 10, ScreenWidth, 60)];
    backV.backgroundColor = [UIColor whiteColor];
    [footView addSubview:backV];
    
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(15, 11, 70, 22)];
    label1.text = @"店铺公告";
    label1.font = [UIFont systemFontOfSize:15];
    [backV addSubview:label1];
    
    textV = [[UITextView alloc]initWithFrame:CGRectMake(85, 4, 215, 45)];
    textV.text = [ShopCommonModel share].notice;
    textV.font = [UIFont systemFontOfSize:15];
    textV.delegate = self;
    [backV addSubview:textV];
    
    replceLabel = [[UILabel alloc]initWithFrame:CGRectMake(90, 12, ScreenWidth-90, 20)];
    replceLabel.text = @"欢迎光临小店(最多输入50个汉字)";
    replceLabel.font = [UIFont systemFontOfSize:15];
    replceLabel.textColor = [UIColor lightGrayColor];
    [backV addSubview:replceLabel];
    if ([ShopCommonModel share].notice.length == 0) {
        replceLabel.hidden = NO;
    }else {
        replceLabel.hidden = YES;
    }
}
-(void)createTable {
    tableV = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-114) style:UITableViewStyleGrouped];
    tableV.delegate = self;
    tableV.dataSource = self;
    tableV.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:tableV];
    tableV.tableFooterView = footView;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
    [tableV addGestureRecognizer:tap];
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
    [self.navBar addGestureRecognizer:tap1];
}
-(void)tapAction{
    [tableV setContentOffset:CGPointMake(0, 0) animated:YES];
    [self.view endEditing:YES];
}
- (void)createPickerView {
    dataArray2 = [[NSMutableArray alloc]init];
    dataArray1 = [[NSMutableArray alloc]init];
    for (int i = 0; i<24; i++) {
        if (i < 10) {
            [dataArray1 addObject:[NSString stringWithFormat:@"0%d:00",i]];
        }else{
            [dataArray1 addObject:[NSString stringWithFormat:@"%d:00",i]];
        }
    }
    for (int i = 1; i<25; i++) {
        if (i < 10) {
            [dataArray2 addObject:[NSString stringWithFormat:@"0%d:00",i]];
        }else{
            [dataArray2 addObject:[NSString stringWithFormat:@"%d:00",i]];
        }
    }
    // 蒙版
    UIWindow *keyWindow=[UIApplication sharedApplication].keyWindow;
    popView=[[UIView alloc]initWithFrame:keyWindow.bounds];
    popView.backgroundColor=SetColor(0, 0, 0, .4);
    popView.alpha=0;
    [keyWindow addSubview: popView];
    UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hidentPopView)];
    [ popView addGestureRecognizer:tap];
    //时间view
    timeView = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenHeight, ScreenWidth, 200)];
    timeView.backgroundColor = [UIColor whiteColor];
    [popView addSubview:timeView];
    //时间view上面的东西
    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 45)];
    backView.backgroundColor = BackColor;
    [timeView addSubview:backView];
    UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    cancelBtn.frame = CGRectMake(0, 0, 60, 45);
    [cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
    [cancelBtn setTitleColor:MainColor forState:UIControlStateNormal];
    [cancelBtn addTarget:self action:@selector(hidentPopViewqq) forControlEvents:UIControlEventTouchUpInside];
    [backView addSubview:cancelBtn];
    UIButton *qdBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qdBtn.frame = CGRectMake(ScreenWidth-60, 0, 60, 45);
    [qdBtn setTitle:@"确定" forState:UIControlStateNormal];
    [qdBtn setTitleColor:MainColor forState:UIControlStateNormal];
    [qdBtn addTarget:self action:@selector(tishi) forControlEvents:UIControlEventTouchUpInside];
    [backView addSubview:qdBtn];
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(60, 0, ScreenWidth-120, 45)];
    label1.text = @"上班时间              下班时间";
    label1.font = [UIFont systemFontOfSize:14];
    label1.textAlignment = NSTextAlignmentCenter;
    label1.textColor = [UIColor lightGrayColor];
    [backView addSubview:label1];
    pickerView = [[UIPickerView alloc]initWithFrame:CGRectMake(0, 40, ScreenWidth, 160)];
    pickerView.delegate = self;
    pickerView.dataSource = self;
    pickerView.showsSelectionIndicator = YES;
    [timeView addSubview:pickerView];
    NSString *kaishi;
    NSString *jieshu;
    if ([ShopCommonModel share].begintime.length == 0 || [ShopCommonModel share].begintime == nil) {
        
    }else {
        kaishi = [[ShopCommonModel share].begintime substringToIndex:2];
        NSLog(@"%@",kaishi);
    }
    if ([ShopCommonModel share].endtime.length == 0 || [ShopCommonModel share].endtime == nil) {
        
    }else {
        jieshu = [[ShopCommonModel share].endtime substringToIndex:2];
        NSLog(@"%@",jieshu);
    }
    NSInteger ks = [kaishi integerValue];
    NSInteger js = [jieshu integerValue];
    [pickerView selectRow:ks inComponent:0 animated:NO];
    [pickerView selectRow:js-1 inComponent:1 animated:NO];
    CGPoint center = timeView.center;
    center.y = ScreenHeight-100;
}
#pragma mark -- UIPickerView的协议方法
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return 2;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    if (component == 0) {
        return dataArray1.count;
    }else {
        return dataArray2.count;
    }
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
    if (component==0) {
        return dataArray1[row];
    }else{
        return dataArray2[row];
    }
}
-(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component {
    return 35;
}
-(CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
    if (component == 0) {
        return ScreenWidth/2+20;
    }else {
        return ScreenWidth/2-20;
    }
}
#pragma mark - 设置piker显示内容
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
    UILabel *myView = nil;
    if (component == 0) {
        myView = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 100, 30)];
        myView.textAlignment = NSTextAlignmentCenter;
        myView.text = [dataArray1 objectAtIndex:row];
        myView.font = [UIFont systemFontOfSize:14];         //用label来设置字体大小
        myView.backgroundColor = [UIColor clearColor];
    }else {
        myView = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 180, 30)];
        myView.text = [dataArray2 objectAtIndex:row];
        myView.textAlignment = NSTextAlignmentCenter;
        myView.font = [UIFont systemFontOfSize:14];
        myView.backgroundColor = [UIColor clearColor];
    }
    return myView;
}
#pragma mark - 确认点击方法
- (void)tishi {
    NSInteger num0 = [pickerView selectedRowInComponent:0];
    NSInteger num1 = [pickerView selectedRowInComponent:1];
    NSLog(@"%ld===%ld",(long)num0,(long)num1);
    if (num0 <= num1) {
        start = [dataArray1 objectAtIndex:[pickerView selectedRowInComponent:0]];
        end = [dataArray2 objectAtIndex:[pickerView selectedRowInComponent:1]];
        CGPoint center = timeView.center;
        center.y = ScreenHeight+100;
        [UIView animateWithDuration:0.2 animations:^{
            timeView.center = center;
            popView.alpha = 0;
        }];
        [tableV reloadData];
    }else {
        CGPoint center = timeView.center;
        center.y = ScreenHeight+100;
        [UIView animateWithDuration:0.2 animations:^{
            timeView.center = center;
            popView.alpha = 0;
        }];
        [[MessShowView share] showWithMess:@"下班时间必须大于上班时间" login:NO];
        return;
    }
}
- (void)hidentPopViewqq {
    CGPoint center = timeView.center;
    center.y = ScreenHeight+100;
    [UIView animateWithDuration:0.2 animations:^{
        timeView.center = center;
        popView.alpha = 0;
    }];
}
#pragma mark - pick滚动代理方法
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    if (component == 0) {
        start = dataArray1[row];
    }else {
        end = dataArray2[row];
    }
}
-(void)hidentPopView {
    CGPoint center = timeView.center;
    center.y = ScreenHeight+100;
    [UIView animateWithDuration:0.2 animations:^{
        timeView.center = center;
        popView.alpha = 0;
    }];
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.0001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 10;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return 60;
    }else{
        return 44;
    }
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 0) {
        return 1;
    }else if (section == 1){
        return 3;
    }else {
        return 2;
    }
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSArray *titleArr = [NSArray array];
    titleArr = @[@[@"店铺LOGO"],@[@"店铺名称",@"营业状态",@"营业时间"],@[@"起送金额",@"配送费"]];
    if (indexPath.section == 0) {
        MyHeaderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!cell) {
            cell = [[[NSBundle mainBundle] loadNibNamed:@"MyHeaderTableViewCell" owner:self options:nil] firstObject];
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        if (headerImg) {
            cell.headerImg.image = headerImg;
        }else{
            [cell.headerImg sd_setImageWithURL:[NSURL URLWithString:[[ShopCommonModel share].shoplogo safeString]] placeholderImage:[UIImage imageNamed:@"touxiang.png"]];
        }
        NSLog(@"%@",[ShopCommonModel share].shoplogo);
        cell.remaindLable.text = [NSString stringWithFormat:@"%@",titleArr[indexPath.section][indexPath.row]];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(logoAction)];
        [cell addGestureRecognizer:tap];
        return cell;
    }else {
        MyMessTableViewCell *bcell = [tableView dequeueReusableCellWithIdentifier:@"dcell"];
        if (!bcell) {
            bcell =  [[[NSBundle mainBundle] loadNibNamed:@"MyMessTableViewCell" owner:self options:nil] firstObject];
        }
        bcell.selectionStyle = UITableViewCellSelectionStyleNone;
        bcell.titleLable.text = [NSString stringWithFormat:@"%@",titleArr[indexPath.section][indexPath.row]];
        bcell.inputTextField.delegate = self;
        if (indexPath.section == 1) {
            if (indexPath.row == 0) { //店铺名称
                bcell.inputTextField.placeholder = @"请输店铺名称";
                bcell.inputTextField.text = shopName;
                bcell.inputTextField.tag = 100;
                bcell.jiantouImg.hidden = YES;
            }else if(indexPath.row == 1){ //营业状态
                if (!swi) {
                    swi = [[UISwitch alloc]initWithFrame:CGRectMake(ScreenWidth-60, 7, 40, 44)];
                    swi.onTintColor = MainColor;
                    [swi addTarget:self action:@selector(changeShopStau:) forControlEvents:UIControlEventValueChanged];
                    [bcell addSubview:swi];
                }
                if ([state isEqualToString:@"1"]) {
                    swi.on = YES;
                    bcell.inputTextField.text = @"营业中";
                }else {
                    swi.on = NO;
                    bcell.inputTextField.text = @"已歇业";
                }
                bcell.inputTextField.textColor = SetColor(255, 64, 0, 1);
                bcell.inputTextField.enabled = NO;
                bcell.jiantouImg.hidden = YES;
            }else if (indexPath.row == 2){ //营业时间
                bcell.inputTextField.text = [NSString stringWithFormat:@"%@至%@",start,end];
                bcell.inputTextField.enabled = NO;
                if ([ShopCommonModel share].begintime.length == 0 || [ShopCommonModel share].begintime == nil) {
                    
                }else {
                    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeTimeAction)];
                    [bcell addGestureRecognizer:tap];
                }
            }
            return bcell;
        }else if (indexPath.section == 2){
            if (indexPath.row == 0) { //起送金额
                bcell.inputTextField.placeholder = @"0";
                bcell.inputTextField.text = minSendMoney;
                bcell.inputTextField.keyboardType =UIKeyboardTypeNumberPad;
                bcell.inputTextField.enabled = YES;
                bcell.jiantouImg.hidden = YES;
                bcell.inputTextField.tag = 400;
            }else if (indexPath.row == 1){ //配送费
                bcell.inputTextField.placeholder = @"0";
                bcell.inputTextField.text = severMoney;
                bcell.inputTextField.keyboardType =UIKeyboardTypeNumberPad;
                bcell.inputTextField.enabled = YES;
                bcell.jiantouImg.hidden = YES;
                bcell.inputTextField.tag = 500;
            }
            return bcell;
        }
        return bcell;
    }
}
-(void)textFieldDidBeginEditing:(UITextField *)textField {
    if (textField.tag == 400 || textField.tag == 500){
        if (ScreenHeight == 480) {
            [UIView animateWithDuration:0.1 animations:^{
                [tableV setContentOffset:CGPointMake(0, 150) animated:YES];
            }];
        }else if (ScreenHeight == 568) {
            [UIView animateWithDuration:0.1 animations:^{
                [tableV setContentOffset:CGPointMake(0, 150) animated:YES];
            }];
        }
    }
}
-(void)textFieldDidEndEditing:(UITextField *)textField {
    if (textField.tag == 100) {
        shopName = textField.text;
    }else if (textField.tag == 400){
        minSendMoney = textField.text;
    }else if (textField.tag == 500){
        severMoney = textField.text;
    }
}
-(void)textViewDidBeginEditing:(UITextView *)textView {
    if (textView.text.length == 0) {
        replceLabel.hidden = NO;
    }
    if (ScreenHeight == 480) {
        [UIView animateWithDuration:0.1 animations:^{
            [tableV setContentOffset:CGPointMake(0, 190) animated:YES];
        }];
    }else if (ScreenHeight == 568) {
        [UIView animateWithDuration:0.1 animations:^{
            [tableV setContentOffset:CGPointMake(0, 150) animated:YES];
        }];
    }
}
-(void)textViewDidChange:(UITextView *)textView {
    if (textView.text.length == 0) {
        replceLabel.hidden = NO;
    }else {
        replceLabel.hidden = YES;
    }
    NSLog(@"%@",textView.text);
    if (textView.text.length > 50) {//此处限制字符长度
        textView.text = [textView.text substringToIndex:50];
    }
}
-(void)textViewDidEndEditing:(UITextView *)textView {
    shopnote = [NSString stringWithFormat:@"%@",textView.text];
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
    
}
-(void)changeShopStau:(UISwitch *)sw {
    if (sw.isOn == YES) {
        state = @"1";
        [tableV reloadData];
    }else {
        state = @"0";
        [tableV reloadData];
    }
}
-(void)changeTimeAction {
    [self.view endEditing:YES];
    [tableV setContentOffset:CGPointMake(0, 0) animated:YES];
    [UIView animateWithDuration:0.2 animations:^{
        popView.alpha=1;
        timeView.frame = CGRectMake(0, ScreenHeight - 200, ScreenWidth, 200);
    }];
}
#pragma mark - 保存方法
-(void)saveBtn {
    [tableV setContentOffset:CGPointMake(0, 0) animated:YES];
    [self.view endEditing:YES];
//    NSString * CT = @"^1\\d{10}$";
//    NSPredicate *regextestct = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CT];
//    BOOL res4 = [regextestct evaluateWithObject:mobile];
//    if (res4) {
//        
//    }else{
//        [[MessShowView share] showWithMess:@"输入的号码格式不正确"];
//        return;
//    }
    NSLog(@"%@======%@======%@======%@======%@======%@======%@",shopName,state,start,end,minSendMoney,severMoney,shopnote);
    NSUserDefaults *userDefaul = [NSUserDefaults standardUserDefaults];
    NSString *cid = [userDefaul objectForKey:@"cid"];
    NSString *url  = [NSString stringWithFormat:upDateShopMsgUrl,[AppData share].username,cid,shopName,state,start,end,minSendMoney,severMoney,shopnote];
    [AFNetworkHandler GETWithAFNByURL:url completion:^(id result) {
        NSDictionary *dic = result;
        if ([[dic objectForKey:@"r"] isEqualToString:@"T"]) {
            [ShopCommonModel share].shopname = shopName; // 超市名称
            [ShopCommonModel share].notice = shopnote; // 公告
            [ShopCommonModel share].openstatu = state; // 状态
            [ShopCommonModel share].begintime = start; // 营业开始时间
            [ShopCommonModel share].endtime = end; // 营业结束时间
            [ShopCommonModel share].minsendamount = minSendMoney; // 起送金额
            [ShopCommonModel share].serviceamount = severMoney; // 服务费
            [tableV reloadData];
            [[MessShowView share] showWithMess:@"修改成功" login:YES];
        }else{
            shopName = [ShopCommonModel share].shopname;
            state = [ShopCommonModel share].openstatu;
            start = [ShopCommonModel share].begintime;
            end = [ShopCommonModel share].endtime;
            minSendMoney = [ShopCommonModel share].minsendamount;
            severMoney = [ShopCommonModel share].serviceamount;
            shopnote = [ShopCommonModel share].notice;
            [tableV reloadData];
            [[MessShowView share] showWithMess:@"修改信息保存失败" login:NO];
        }
    }];
}
-(void)logoAction {
    [[PhotoPickerManager shared] showActionSheetInView:self.view fromController:self completion:^(UIImage *image) {
        headerImg = image;
        [self sendImg];
    } cancelBlock:^{
        
    }];
}
#pragma mark- 上传图片
- (void)sendImg {
    NSUserDefaults *userDefaul = [NSUserDefaults standardUserDefaults];
    NSString *iptype = [userDefaul objectForKey:@"iptype"];
    NSString *banben = [userDefaul objectForKey:@"banben"];
//    NSString *url = [NSString stringWithFormat:SendHeaderImg,[AppData share].username,[Utils md5SignStr],iptype,banben];
    NSString *url = [NSString stringWithFormat:LZGSendHeaderImg,[AppData share].username,[Utils md5SignStr],iptype,banben];
    NSLog(@"%@",url);
    [NTNetUtil postImgWithParam:nil requestUrl:url dataArr:@[headerImg] block:^(NTHttpRequest *networkRequest, NSError *error) {
        NSDictionary *dic = networkRequest.responseData;
        NSLog(@"------%@",dic);
        NSString *suc= dic[@"r"];
        if ([suc isEqualToString:@"T"]) {
            [[MessShowView share] showWithMess:@"上传图片成功"];
            [ShopCommonModel share].shoplogo = dic[@"imgurl"];
            [tableV reloadData];
        }else {
            [[MessShowView share] showWithMess:@"上传图片失败"];
        }
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
@end